import request from '@/utils/request'

// 查询渠道提报和采购单关系列表
export function listPoRelation(query) {
  return request({
    url: '/productAllocation/poRelation/list',
    method: 'get',
    params: query
  })
}
// 查询渠道提报和采购单关系列表
export function getDistinctPurchaseOrderNumbers(query) {
  return request({
    url: '/productAllocation/trigger/getDistinctPurchaseOrderNumbers',
    method: 'get',
    params: query
  })
}
// 查询渠道提报和采购单关系详细
export function getPoRelation(id) {
  return request({
    url: '/productAllocation/poRelation/' + id,
    method: 'get'
  })
}

// 新增渠道提报和采购单关系
export function addPoRelation(data) {
  return request({
    url: '/productAllocation/poRelation',
    method: 'post',
    data: data
  })
}
// 新增渠道提报和采购单关系
export function checkChannelOrderWareHouseBinding(data) {
  return request({
    url: '/productAllocation/poRelation/checkChannelOrderWareHouseBinding',
    method: 'post',
    data: data
  })
}
// 新增渠道提报和采购单关系
export function checkMatch(data) {
  return request({
    url: '/productAllocation/poRelation/checkMatch',
    method: 'post',
    data: data
  })
}
// 新增渠道提报和采购单关系
export function syncChannelSubmissionData(data) {
  return request({
    url: '/productAllocation/poRelation/syncChannelSubmissionData',
    method: 'post',
    data: data
  })
}
// 新增渠道提报和采购单关系
export function getMatchInfo(data) {
  return request({
    url: '/productAllocation/poRelation/getMatchInfo',
    method: 'post',
    data: data.data,
    params: data.query
  })
}
// 修改渠道提报和采购单关系
export function updatePoRelation(data) {
  return request({
    url: '/productAllocation/poRelation',
    method: 'put',
    data: data
  })
}

// 删除渠道提报和采购单关系
export function delPoRelation(id) {
  return request({
    url: '/productAllocation/poRelation/' + id,
    method: 'delete'
  })
}
